<?php
use yii\helpers\Url;
use yii\web\View;
use app\assets\CreativeVideoPreviewAsset;
CreativeVideoPreviewAsset::register($this);
$this->title = \Yii::t('creative', 'Creative Preview').'--'.\Yii::$app->params['sysMsg']['company'].' Ad Server';
?>
<style>
  html,body,.cont{background-color: #fff;} 
</style>
<div class="row">
  <div class="col-sm-12">
    <div class="row">
      <div class="col-sm-12">
        <div class="details-content">
          <div class="heading">
            <h4><?=\Yii::t('creative', 'Material Preview')?>：</h4>
          </div>
          <div class="details-wrap">
            <div class="details" id="video-preview-details">
            </div>
          </div>
          <div class="preview-operate">
            <div class="tab-btn-group pull-right" id="dsp-preview-op">
            </div>
          </div>
        </div>
      </div>
      <input type="hidden" class="creative-id" name="uuid" value="<?= $creative_id ?>">
      <input type="hidden" class="creative-type" name="type" value="<?= $preview['list'][0]['format']?>" >
      <input type="hidden" class="creative-url" name="url" value="<?= $preview['list'][0]['url']?>">
    </div>
    <div class="details-sync-content">
      <div class="heading">
        <h4><?=\Yii::t('creative', 'Material List')?>：</h4>
      </div>
      <table class="table table-striped table-hover table-condensed">
        <thead>
          <tr>
            <th><?=\Yii::t('creative', 'Material Type')?></th>
            <th class=""><?=\Yii::t('creative', 'Material Format')?></th>
            <th class=""><?=\Yii::t('creative', 'Material Url')?></th>
            <th><?=\Yii::t('creative', 'Action')?></th>
          </tr>
        </thead>
        <tbody>
        </tbody>
      </table>
    </div>
   </div>           
</div>

<?php
  $videoPluginUrl = Yii::getAlias('@web/').Yii::$app->params['envDir'].'/js/vendor/flowplayer/flowplayer.swf';
  $materialListUrl = Url::to(['cpe-preview']);
  // $materialListUrl = Yii::getAlias('@web').'/response/creative/cpeMaterialsUrlData.php';
  $this->registerJs("VAM.setVar('VIDEO_PLUGIN_URL','$videoPluginUrl');", View::POS_END);
  $this->registerJs("VAM.setVar('DATA_CPE_MATERIALS_URL','$materialListUrl');", View::POS_END);
?>
<script type="text/javascript" >
  requirejs(["<?= Yii::getAlias('@web/').Yii::$app->params['envDir'];?>/js/site.js"], function(common) {
    requirejs(["<?= Yii::getAlias('@web/').Yii::$app->params['envDir'];?>/js/creative/creativeCpePreview.js"]);
  });
</script>